"""

@File:run_suite.py
@Datetime:2022/11/12 22:50
@Author:wangt
@Desc:
"""
# 1.导包
import unittest

from htmltestreport import HTMLTestReport

from scripts.test_index import TestEgoIndex
from scripts.test_user import TestUser
# 2.创建测试套件对象
suite = unittest.TestSuite()
# 3.添加测试用例到套件
suite.addTest(unittest.makeSuite(TestEgoIndex))
suite.addTest(unittest.makeSuite(TestUser))
# 4.设置报告保存路径
report_dir = "./reports"  # 相对路径
# report_dir = BASE_DIR + "/reports" # 绝对路径
report_name = report_dir + '/' + 'ego_test_report.html'
# 4.创建 HTMLTestReport 实例
runner = HTMLTestReport(report_name, description="ego微商小程序项目", title="ego微商首页&用户接口测试")
# 5.调用 run() 传入 suite.
runner.run(suite)